home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / misc / evenmore / rexx / funnytalk.rexx < prev    next >
OS/2 REXX Batch file  |  1999-04-28  |  7KB  |  160 lines

  1. /*****************************************************/
  2. /*                                                   */
  3. /* Funnytalk.rexx                                    */
  4. /*  for EvenMore - Copyright Chris Perver @1996-1998 */
  5. /*                                                   */
  6. /****************************************************/
  7.  
  8. address 'EvenMore.1'
  9.  
  10. options results
  11. "GETTOTALLINES"
  12. totlines = RESULT
  13.  
  14. If Open(file,'Ram:funnytalk','W') then
  15.   do
  16.  
  17.     line = 1
  18.     do while line<totlines
  19.       "GETLINE "line
  20.       text = RESULT
  21.       if text~='' then
  22.         do
  23.           text = rude(text)
  24.         end
  25.       Call Writeln(file, text)
  26.       line = line + 1
  27.       say totlines - line
  28.     end
  29.     Call Close(file)
  30.   end
  31.  
  32. "OPEN Ram:funnytalk"
  33. exit
  34.  
  35. rude:
  36.   parse var text
  37.   if random(1,4,time('S'))=1 then
  38.   do
  39.     pos=pos('!',text,random(1,length(text),time('S')))
  40.     if pos>0 then text=insert('. So there',text,pos-1)
  41.   end
  42.   if random(1,4,time('S'))=1 then
  43.   do
  44.     pos=pos('?',text,random(1,length(text),time('S')))
  45.     if pos>0 then text=insert(', ok mate',text,pos-1)
  46.   end
  47.   if random(1,4,time('S'))=1 then
  48.   do
  49.     pos=pos('. ',text,random(1,length(text),time('S')))
  50.     if pos>0 then text=insert('. ''S coo'', bro',text,pos-1)
  51.   end
  52.   if random(1,4,time('S'))=1 then
  53.   do
  54.     pos=pos('. ',text,random(1,length(text),time('S')))
  55.     if pos>0 then text=insert('. What it is, mama',text,pos-1)
  56.   end
  57.   if random(1,4,time('S'))=1 then
  58.   do
  59.     pos=pos('. ',text,random(1,length(text),time('S')))
  60.     if pos>0 then text=insert('. Ah be baaad',text,pos-1)
  61.   end
  62.   /* space around words to ensure we are dealing with a whole word */
  63.   /* or else sounds have to be compatible with every phrase        */
  64.  
  65.   text=wordcheck(' hello | yo ')               /* hello         */
  66.   text=wordcheck(' isn''t | ain''t ')          /* isn't         */
  67.   text=wordcheck(' a | some ')                 /* a             */
  68.   text=wordcheck(' are | is ')                 /* are           */
  69.   text=wordcheck(' is | be ')                  /* is            */
  70.   text=wordcheck(' name | dojigger ')          /* name          */
  71.   text=wordcheck(' today | the ''savo ')       /* today         */
  72.   text=wordcheck(' you | ya'' ')               /* you           */
  73.   text=wordcheck(' you all | yall ')           /* you all       */
  74.   text=wordcheck(' it is | ''tis ')            /* it is         */
  75.   text=wordcheck(' yes | yep ')                /* yes           */
  76.   text=wordcheck(' no | nah ')                 /* no            */
  77.   text=wordcheck(' to | t''')                  /* to            */
  78.   text=wordcheck(' that | t''at ')             /* that          */
  79.   text=wordcheck(' just | but ')               /* just          */
  80.   text=wordcheck(' mother | ma ')              /* mother        */
  81.   text=wordcheck(' woman | mama ')             /* woman         */
  82.   text=wordcheck(' man | dude ')               /* man           */
  83.   text=wordcheck(' father | pa ')              /* father        */
  84.   text=wordcheck(' sister | sis'' ')           /* sister        */
  85.   text=wordcheck(' friend | homey ')           /* friend        */
  86.   text=wordcheck(' my | mah'' ')               /* my            */
  87.   text=wordcheck(' we | us ')                  /* we            */
  88.   text=wordcheck(' am | be ')                  /* am            */
  89.   text=wordcheck(' i | ah'' ')                 /* i             */
  90.   text=wordcheck(' man | dude ')               /* man           */
  91.   text=wordcheck(' one | un'' ')               /* one           */
  92.   text=wordcheck(' beat | whup'' ')            /* beat          */
  93.   text=wordcheck(' dead | deed ')              /* dead          */
  94.   text=wordcheck(' dead | beat ')              /* dead          */
  95.   text=wordcheck(' dead | gone ')              /* dead          */
  96.   text=wordcheck(' big | hefty ')              /* big           */
  97.   text=wordcheck(' big | huge ')               /* big           */
  98.   text=wordcheck(' large | goofy ')            /* large         */
  99.   text=wordcheck(' large | lanky ')            /* large         */
  100.   text=wordcheck(' small | wee ')              /* small         */
  101.   text=wordcheck(' small | shrimp ')           /* small         */
  102.   text=wordcheck(' Windows95 | Windoof95 ')    /* Windows95     */
  103.   text=wordcheck(' Windows95 | Winblows95 ')   /* Windows95     */
  104.   text=wordcheck(' Windows95 | Windoze95 ')    /* Windows95     */
  105.   text=wordcheck(' MSDos | MSDog ')            /* MSDos         */
  106.   text=wordcheck(' MicroSoft | MicroSmell ')   /* Microsoft     */
  107.   text=wordcheck(' MicroSoft | MicroSh*t ')    /* Microsoft     */
  108.   text=wordcheck(' MicroSoft | MicroSick ')    /* Microsoft     */
  109.   text=wordcheck(' MicroSoft | MicroSlick ')   /* Microsoft     */
  110.   text=wordcheck(' MicroSoft | MicroSloth ')   /* Microsoft     */
  111.   text=wordcheck(' any | no ')                 /* any           */
  112.   text=wordcheck(' of | uh ')                  /* of            */
  113.   text=wordcheck(' the | da ')                 /* the           */
  114.   text=wordcheck(':|, dig dis:')               /* :             */
  115.   text=wordcheck(' up | down ')                /* up            */
  116.   text=wordcheck(' down | waay down ')         /* down          */
  117.   text=wordcheck(' sure | sho'' nuff ')        /* sure          */
  118.   text=wordcheck(' sort of | radical ')        /* sort of       */
  119.   text=wordcheck(' have | gots'' ')            /* have          */
  120.   text=wordcheck(' money | bre''d ')           /* money         */
  121.   text=wordcheck(' cash | bre''d ')            /* money         */
  122.   text=wordcheck(' very | real ')              /* very          */
  123.  
  124.   text=wordcheck('tion|shun')                  /* tion words    */
  125.   text=wordcheck('er |a'' ')                   /* er words      */
  126.   text=wordcheck('ing |in'' ')                 /* ing words     */
  127.   text=wordcheck('ork|urk')                    /* ork words     */
  128.   text=wordcheck('ork|erk')                    /* ork words     */
  129.   text=wordcheck('or|o''')                     /* or words      */
  130.   text=wordcheck('of|o''')                     /* of words      */
  131.   text=wordcheck('o |o''s ')                   /* o  words      */
  132.   text=wordcheck('th|d')                       /* th words      */
  133.   text=wordcheck('th|v')                       /* th words      */
  134.   text=wordcheck('e |es ')                     /* e words       */
  135.   text=wordcheck('s |sh ')                     /* s words       */
  136.   text=wordcheck(' ca| ki')                    /* ca words      */
  137.   text=wordcheck('tt|tst')                     /* tt words      */
  138.   text=wordcheck('tch|sh')                     /* tch words     */
  139.   text=wordcheck('ai|e')                       /* ai words      */
  140.   text=wordcheck('ou|u')                       /* ou words      */
  141.   text=wordcheck('ight|ite')                   /* ight words    */
  142.   text=wordcheck(' su| schu')                  /* su words      */
  143.   text=wordcheck('at |ut ')                    /* at words      */
  144.   text=wordcheck('as |uz ')                    /* as words      */
  145.   text=wordcheck('oes|uz')                     /* oes words     */
  146. return text
  147.  
  148. wordcheck:
  149.   parse arg oldword'|'newword
  150.   stringpos=pos(Upper(oldword),Upper(text))
  151.   do while stringpos>0
  152.     if random(1,2,time('S'))=1 then
  153.     do
  154.       text=delstr(text,stringpos,length(oldword))
  155.       text=insert(newword,text,stringpos-1)
  156.     end
  157.     stringpos=pos(Upper(oldword),Upper(text),stringpos+length(newword))
  158.   end
  159. return text
  160.